package ctn.hibernate.po;

// Generated 2011-12-8 2:29:36 by Hibernate Tools 3.2.4.GA

import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * CpaFun generated by hbm2java
 */
@Entity
@Table(name = "cpa_fun", catalog = "cpa")
public class CpaFun implements java.io.Serializable {

	private Long id;
	private CtnCpaInfo ctnCpaInfo;
	private String funName;
	private Long implUserId;
	private Date completeDate;
	private Date createDate;
	private Date startDate;
	private Date planEndDate;
	private String status;
	private Long level;
	private Long stage;
	private String funDesc;
	private Set<CtnCpaSpec> ctnCpaSpecs = new HashSet<CtnCpaSpec>(0);
	private Set<CtnCpaOut> ctnCpaOuts = new HashSet<CtnCpaOut>(0);

	private String createName;
	private CtnCpaVer ctnCpaVer;
	
	public CpaFun() {
	}

	public CpaFun(CtnCpaInfo ctnCpaInfo, String funName, Long level, Long stage) {
		this.ctnCpaInfo = ctnCpaInfo;
		this.funName = funName;
		this.level = level;
		this.stage = stage;
	}
	public CpaFun(CtnCpaInfo ctnCpaInfo,CtnCpaVer ctnCpaVer, String funName, Long level, Long stage) {
		this.ctnCpaVer=ctnCpaVer;
		this.ctnCpaInfo = ctnCpaInfo;
		this.funName = funName;
		this.level = level;
		this.stage = stage;
	}
	public CpaFun(CtnCpaInfo ctnCpaInfo, String funName, Long implUserId,
			Date completeDate, Date startDate, Date planEndDate, String status,
			Long level, Long stage, Set<CtnCpaSpec> ctnCpaSpecs,
			Set<CtnCpaOut> ctnCpaOuts) {
		this.ctnCpaInfo = ctnCpaInfo;
		this.funName = funName;
		this.implUserId = implUserId;
		this.completeDate = completeDate;
		this.startDate = startDate;
		this.planEndDate = planEndDate;
		this.status = status;
		this.level = level;
		this.stage = stage;
		this.ctnCpaSpecs = ctnCpaSpecs;
		this.ctnCpaOuts = ctnCpaOuts;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "ID", unique = true, nullable = false)
	public Long getId() {
		return this.id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "CPA_ID", nullable = false)
	public CtnCpaInfo getCtnCpaInfo() {
		return this.ctnCpaInfo;
	}

	public void setCtnCpaInfo(CtnCpaInfo ctnCpaInfo) {
		this.ctnCpaInfo = ctnCpaInfo;
	}

	@Column(name = "FUN_NAME", nullable = false, length = 50)
	public String getFunName() {
		return this.funName;
	}

	public void setFunName(String funName) {
		this.funName = funName;
	}

	@Column(name = "IMPL_USER_ID")
	public Long getImplUserId() {
		return this.implUserId;
	}

	public void setImplUserId(Long implUserId) {
		this.implUserId = implUserId;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "COMPLETE_DATE", length = 19)
	public Date getCompleteDate() {
		return this.completeDate;
	}

	public void setCompleteDate(Date completeDate) {
		this.completeDate = completeDate;
	}
	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "CREATE_DATE", length = 19)
	public Date getCreateDate() {
		return createDate;
	}

	public void setCreateDate(Date createDate) {
		this.createDate = createDate;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "START_DATE", length = 19)
	public Date getStartDate() {
		return this.startDate;
	}

	public void setStartDate(Date startDate) {
		this.startDate = startDate;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "PLAN_END_DATE", length = 19)
	public Date getPlanEndDate() {
		return this.planEndDate;
	}

	public void setPlanEndDate(Date planEndDate) {
		this.planEndDate = planEndDate;
	}

	@Column(name = "STATUS", length = 1)
	public String getStatus() {
		return this.status;
	}

	public void setStatus(String status) {
		this.status = status;
	}

	@Column(name = "LEVEL", nullable = false)
	public Long getLevel() {
		return this.level;
	}

	public void setLevel(Long level) {
		this.level = level;
	}

	@Column(name = "STAGE")
	public Long getStage() {
		return this.stage;
	}

	public void setStage(Long stage) {
		this.stage = stage;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "cpaFun")
	public Set<CtnCpaSpec> getCtnCpaSpecs() {
		return this.ctnCpaSpecs;
	}

	public void setCtnCpaSpecs(Set<CtnCpaSpec> ctnCpaSpecs) {
		this.ctnCpaSpecs = ctnCpaSpecs;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "cpaFun")
	public Set<CtnCpaOut> getCtnCpaOuts() {
		return this.ctnCpaOuts;
	}

	public void setCtnCpaOuts(Set<CtnCpaOut> ctnCpaOuts) {
		this.ctnCpaOuts = ctnCpaOuts;
	}
	@Column(name = "fun_desc", length = 300)
	public String getFunDesc() {
		return funDesc;
	}

	public void setFunDesc(String funDesc) {
		this.funDesc = funDesc;
	}
	@Column(name = "create_name", length = 32)
	public String getCreateName() {
		return createName;
	}

	public void setCreateName(String createName) {
		this.createName = createName;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "ver_id", nullable = false)
	public CtnCpaVer getCtnCpaVer() {
		return ctnCpaVer;
	}

	public void setCtnCpaVer(CtnCpaVer ctnCpaVer) {
		this.ctnCpaVer = ctnCpaVer;
	}

	

}
